3.288 \(\int \cos ^3(e+f x) (b \csc (e+f x))^n \, dx\)

Optimal. Leaf size=52 \[ \frac{b (b \csc (e+f x))^{n-1}}{f (1-n)}-\frac{b^3 (b \csc (e+f x))^{n-3}}{f (3-n)} \]

[Out]

-((b^3*(b*Csc[e + f*x])^(-3 + n))/(f*(3 - n))) + (b*(b*Csc[e + f*x])^(-1 + n))/(f*(1 - n))

________________________________________________________________________________________

Rubi [A]  time = 0.0516861, antiderivative size = 52, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {2621, 14} \[ \frac{b (b \csc (e+f x))^{n-1}}{f (1-n)}-\frac{b^3 (b \csc (e+f x))^{n-3}}{f (3-n)} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]^3*(b*Csc[e + f*x])^n,x]

[Out]

-((b^3*(b*Csc[e + f*x])^(-3 + n))/(f*(3 - n))) + (b*(b*Csc[e + f*x])^(-1 + n))/(f*(1 - n))

Rule 2621

Int[(csc[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> -Dist[(f*a^n)^(-1), Subst
[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Csc[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && Integer
Q[(n + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \cos ^3(e+f x) (b \csc (e+f x))^n \, dx &=-\frac{b^3 \operatorname{Subst}\left (\int x^{-4+n} \left (-1+\frac{x^2}{b^2}\right ) \, dx,x,b \csc (e+f x)\right )}{f}\\ &=-\frac{b^3 \operatorname{Subst}\left (\int \left (-x^{-4+n}+\frac{x^{-2+n}}{b^2}\right ) \, dx,x,b \csc (e+f x)\right )}{f}\\ &=-\frac{b^3 (b \csc (e+f x))^{-3+n}}{f (3-n)}+\frac{b (b \csc (e+f x))^{-1+n}}{f (1-n)}\\ \end{align*}

Mathematica [A]  time = 0.126489, size = 45, normalized size = 0.87 \[ -\frac{b ((n-1) \cos (2 (e+f x))+n-5) (b \csc (e+f x))^{n-1}}{2 f (n-3) (n-1)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]^3*(b*Csc[e + f*x])^n,x]

[Out]

-(b*(-5 + n + (-1 + n)*Cos[2*(e + f*x)])*(b*Csc[e + f*x])^(-1 + n))/(2*f*(-3 + n)*(-1 + n))

________________________________________________________________________________________

Maple [F]  time = 1.153, size = 0, normalized size = 0. \begin{align*} \int \left ( \cos \left ( fx+e \right ) \right ) ^{3} \left ( b\csc \left ( fx+e \right ) \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)^3*(b*csc(f*x+e))^n,x)

[Out]

int(cos(f*x+e)^3*(b*csc(f*x+e))^n,x)

________________________________________________________________________________________

Maxima [A]  time = 1.1554, size = 78, normalized size = 1.5 \begin{align*} \frac{\frac{b^{n} \sin \left (f x + e\right )^{-n} \sin \left (f x + e\right )^{3}}{n - 3} - \frac{b^{n} \sin \left (f x + e\right )^{-n} \sin \left (f x + e\right )}{n - 1}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(b*csc(f*x+e))^n,x, algorithm="maxima")

[Out]

(b^n*sin(f*x + e)^(-n)*sin(f*x + e)^3/(n - 3) - b^n*sin(f*x + e)^(-n)*sin(f*x + e)/(n - 1))/f

________________________________________________________________________________________

Fricas [A]  time = 1.7469, size = 115, normalized size = 2.21 \begin{align*} -\frac{{\left ({\left (n - 1\right )} \cos \left (f x + e\right )^{2} - 2\right )} \left (\frac{b}{\sin \left (f x + e\right )}\right )^{n} \sin \left (f x + e\right )}{f n^{2} - 4 \, f n + 3 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(b*csc(f*x+e))^n,x, algorithm="fricas")

[Out]

-((n - 1)*cos(f*x + e)^2 - 2)*(b/sin(f*x + e))^n*sin(f*x + e)/(f*n^2 - 4*f*n + 3*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)**3*(b*csc(f*x+e))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (b \csc \left (f x + e\right )\right )^{n} \cos \left (f x + e\right )^{3}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(b*csc(f*x+e))^n,x, algorithm="giac")

[Out]

integrate((b*csc(f*x + e))^n*cos(f*x + e)^3, x)